<template>
    <div>
        <button @click="sendMsg">Send</button>
    </div>
</template>

<script setup>
//
//npm install ws --save
//

import Ws from './Ws';
let ws=null;
const init=async ()=>{
    ws=await Ws.create('ws://localhost:8000');
}
const sendMsg=()=>{
    if(ws){
        ws.sendMsg({
            mode:'MESSAGE',
            msg:'Hello'
        })
    }
}
init();
</script>